package xyz.k1998.springboot.mapper;

import org.apache.ibatis.annotations.*;
import xyz.k1998.springboot.bean.Department;

import java.util.List;


public interface DepartmentMapper {

    @Select("select * from department where id = #{id}")
    public Department getDeptById(Integer id);

    @Select("select * from department")
    public List<Department> findAll();

    @Delete("delete from department where id=#{id}")
    public int deleteDeptById(Integer id);

    @Insert("insert into department values(#{id},#{name},#{age})")
    public int insertDeptById(Department department);

    @Update("update department set name = #{name} where id=#{id}")
    public int updateDeptById(Department department);

}